package section1_5;

import java.util.concurrent.TimeUnit;

/**
 * Created by Hyman on 2017/4/24.
 *
 * 线程中断的控制
 */
public class Main {

    public static void main(String[] args) {

        FileSearch searcher = new FileSearch("C:\\", "bootstat.dat");
        Thread thread = new Thread(searcher);
        thread.start();

        try {
            TimeUnit.SECONDS.sleep(8);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        // 质数生成线程中断
        thread.interrupt();
    }
}
